<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        .title {
            height: 40px;
            text-align: center;
            margin-bottom: 30px;
        }

        .title h2 {
            font-size: 20px;
            font-weight: 700;
            margin-bottom: 10px;
        }

        .list .item {
            height: 50px;
            margin: 10px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            border: 1px solid orange;
            background-color: bisque;
        }

        .list .item img {
            border-radius: 50%;
            width: 60px;
        }

        .list .item .middle .name {
            color: bisque;
        }

        .list .item .middle .desc {
            font-size: 12px;
        }
    </style>
</head>

<body>
    <div id="app">
        <div class="title">
            <h2>任务列表</h2>
            <p>每完成一个任务，即可获得10MB~1G B流量哦!</p>
        </div>
        <div class="list">
            <div class="item" v-for="(item,index) in tasklist" v-bind:key="index">
                <div class="left">
                    <img v-bind:src="item.pic" alt="">
                </div>
                <div class="middle">
                    <div class="name"> {{ item.name }} </div>
                    <div class="desc"> {{ item.desc }} </div>
                </div>
                <div class="right">
                    <button> {{ item.status == 1 ? "去完成" : item.status == 2 ? "领取" : "已领取" }}</button>
                </div>
            </div>
        </div>
    </div>
</body>

</html>
<script src="./vue-2.5.21.js"></script>

<script>
    // 实例化一个vue对象
    let v = new Vue({
        el: '#app',//挂载得dom节点
        data: {
            tasklist: [
                { id: 1, url: 'iiii', pic: './img/pic1.jpg', name: '咪咕视频送流量', desc: '来咪咕视频，每月领500MB流量奖励', status: 1 },
                { id: 2, url: 'iiii', pic: './img/pic2.jpg', name: '和彩云送福利', desc: '免费领100G空间+月月2GB', status: 2 },
                { id: 3, url: 'iiii', pic: './img/pic3.jpg', name: '最高40元套餐折扣券', desc: '参与抽奖，奖励10MB，经验值+10', status: 3 },
                { id: 4, url: 'iiii', pic: './img/pic4.jpg', name: '吃喝玩乐季，超级秒杀', desc: '进入隐藏二楼参与秒杀，奖励10MB，经验值+10', status: 1 },
            ]
        },
        computed: {},
        watch: {},
        filters: {},
        directives: {},
        components: {}
    })
</script>